<?php
class ez_FrontAbstract extends ez_Abstract
{
	private $_blockCollections;
	private $_layout;
	
	protected function loadBlock($blockPath)
	{
		require (str_replace('/',DS,$blockPath.'.php'));
		$blockClass = new ReflectionClass('Block_'.str_replace('/','_',$blockPath));
		$block = $blockClass->newInstance();
		$block->setBlockPath($blockPath);
		$this->_blockCollections[$blockPath] = $block;
		//return $block;
	}
	
	protected function prepareBlock()
	{
		
	}
	
	protected function getBlock($blockPath)
	{
		return $this->_blockCollections[$blockPath];
	}
	
	protected function getBlockHtml($blockPath)
	{
		$this->loadBlock($blockPath);
		$this->prepareBlock();
		
		if ($this->_blockCollections[$blockPath]) {
			$block = $this->_blockCollections[$blockPath];
			$block->renderView();
		}
	}
}